<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@include file="../include/base.jsp" %>
<!DOCTYPE HTML>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">	
	<title>CRM-contact-edit</title>
	<meta charset="UTF-8">
	<%@ include file="../include/head.jsp" %>
</head>

<body class="crm">
	
<jsp:include page="../include/top.jsp">
	<jsp:param value="contact" name="tag"/>
</jsp:include>


<div class="container-fluid">
	<div class="row-fluid">
	<div class="span8">
		<div class="well screen">
			<div class="page-header header">
				编辑联系人
			</div>
			<div class="live_search_spinner" behavior="spinner" id="parties_loading">
			  <div class="liner">
			    <h3>处理中...</h3>
			    <img src="${basePath }/img/indicator.gif" alt="WorkXP">
			  </div>
			</div>
			<div class="main" id="main">
				


			<form accept-charset="UTF-8" action="${basePath }/contact/update" class="simple_form form-horizontal" id="contact_form" method="post" novalidate="novalidate">
				<div style="margin:0;padding:0;display:inline"><input name="utf8" value="✓" type="hidden"><input name="authenticity_token" value="gvl3KUeUydwCvmam1IydcyN/0YreGrEYHrUqSBlgGpo=" type="hidden"></div>
				
				<div class="control-group string required">
					<label class="string required control-label" for="person_name"><abbr title="required">*</abbr> 姓名</label>
					<div class="controls">
						<input type="hidden" name="t" value="edit"/>
						<input type="hidden" name="id" value="${contact.id }"/>
						<input class="string required" id="person_name" name="contact.name" size="50" type="text" value="${contact.name }">
					</div>
				</div>
				 
				<div class="control-group string optional marco_polo_container">
					<label class="string optional control-label" for="person_company_name"> 公司</label>
					<div class="controls">
						<input autocomplete="off" class="string optional input-xlarge mp_input" id="person_company_name" name="contact.companyname" value="${contact.companyname }" size="50" type="text">
						<ul style="display: none;" class="typeahead dropdown-menu mp_list"></ul>
					</div>
				</div>
				<input id="person_company_id" name="person[company_id]" type="hidden">
				
				
				<script type="text/javascript" charset="utf-8">
					$(document).ready(function() {
						$('#person_company_name').marcoPolo({
						  url: 'search.action',
						  formatItem: function (data, $item) {
						    return data.companyname;
						  },
						  onSelect: function (data, $item) {
						    $('#person_company_name').val(data.companyname);
								$('#person_company_id').val(data.id);
						  }
						});
						validate_form("#contact_form");
						$('#person_name').focus();
					});
				</script>
				
				
				<div class="control-group string optional">
					<label class="string optional control-label" for="person_title">
						职位
					</label>
					<div class="controls">
						<input class="string optional" id="person_title" name="contact.title" value="${contact.title }" size="50" type="text">
					</div>
				</div>
				
				
				
				<div class="control-group tel optional">
					<label class="tel optional control-label" for="person_contact_phone"> 电话</label><div class="controls">
					<c:choose>
					<c:when test="${fn:length(contact.telList) == 0 }">
						<div class="contact_forms contact_phones" id="contact_phone_list_company">
							<div id="blank_slate_company_contact_phone" class="blank_slate">添加一个电话号码</div>
							<div class="contact_methods" style="display: none;">
						  			
							<div id="contact_phone_8f8a3e00-c17f-012f-5d5c-000c29568e7b" class="contact_method new_contact_method edit_phone">
								
								<input type="hidden" name="telids" value="">
								<input class="autofocus" id="person_contact_phones__value" name="tels" size="30" type="text">
								<select id="person_contact_phones__key" name="teltypes"><option selected="selected" value="office">公司</option>
									<option value="work">工作</option>
									<option value="mobile">手机</option>
									<option value="fax">传真</option>
									<option value="home">住宅</option>
									<option value="other">其它</option>
								</select>
								<span class="addremove"><a href="#" class="remove">Remove</a></span>
							</div>
							<div id="add_company_contact_phone" class="add_contact_method" style="display: none;">
							  <div class="add"><a href="#">添加..</a></div>
							</div>
							</div>
						</div>
					</c:when>
					<c:otherwise>
						
						<div class="contact_forms contact_phones" id="contact_phone_list_company">
						  	<div id="blank_slate_company_contact_phone" class="blank_slate" style="cursor:pointer;">添加一个电话号码</div>
							<div class="contact_methods" style="display: none;">
								<c:forEach items="${contact.telList }" var="tel">
								<div id="contact_phone_8f8a3e00-c17f-012f-5d5c-000c29568e7b" class="contact_method new_contact_method edit_phone">
			
									<input type="hidden" name="telids" value="${tel.id }">					
									<input class="autofocus" id="person_contact_phones__value" name="tels" size="30" type="text" value="${tel.tel }">
									<select id="person_contact_phones__key" name="teltypes">
										<c:choose>
											<c:when test="${tel.type == 'office' }">
												<option value="office" selected="selected">公司</option>
											</c:when>
											<c:otherwise>
												<option value="office">公司</option>
											</c:otherwise>
										</c:choose>
										<c:choose>
											<c:when test="${tel.type == 'work' }">
												<option value="work" selected="selected">工作</option>
											</c:when>
											<c:otherwise>
												<option value="work">工作</option>
											</c:otherwise>
										</c:choose>
										<c:choose>
											<c:when test="${tel.type == 'mobile' }">
												<option value="mobile" selected="selected">手机</option>
											</c:when>
											<c:otherwise>
												<option value="mobile">手机</option>
											</c:otherwise>
										</c:choose>
										<c:choose>
											<c:when test="${tel.type == 'fax' }">
												<option value="fax" selected="selected">传真</option>
											</c:when>
											<c:otherwise>
												<option value="fax">传真</option>
											</c:otherwise>
										</c:choose>
										<c:choose>
											<c:when test="${tel.type == 'home' }">
												<option value="home" selected="selected">住宅</option>
											</c:when>
											<c:otherwise>
												<option value="home">住宅</option>
											</c:otherwise>
										</c:choose>
										<c:choose>
											<c:when test="${tel.type == 'other' }">
												<option value="other" selected="selected">其它</option>
											</c:when>
											<c:otherwise>
												<option value="other">其它</option>
											</c:otherwise>
										</c:choose>
									</select>
									<span class="addremove"><a href="#" class="remove">Remove</a></span>
								</div>
								</c:forEach>
								<div id="add_company_contact_phone" class="add_contact_method" style="display: none;">
								  <div class="add"><a href="#">添加..</a></div>
								</div>
							</div>
						</div>
						
					</c:otherwise>
					</c:choose>
					<script type="text/javascript">
						//<![CDATA[
						$(document).ready(function() {
							var contact_phone_manger = new ContactInfo.ContactForm("#contact_phone_list_company", "<div id=\"contact_phone_{safe_id}\" class=\"contact_method new_contact_method edit_phone\">\n	\n		<input class=\"autofocus\" id=\"person_contact_phones__value\" name=\"tels\" size=\"30\" type=\"text\" />\n		<select id=\"person_contact_phones__key\" name=\"teltypes\"><option value=\"office\">公司<\/option>\n<option value=\"work\">工作<\/option>\n<option value=\"mobile\">手机<\/option>\n<option value=\"fax\">传真<\/option>\n<option value=\"home\">住宅<\/option>\n<option value=\"other\">其它<\/option><\/select>\n		<span class=\"addremove\"><a href=\"#\" class=\"remove\">Remove<\/a><\/span>\n<\/div>");
							setInterval(function(){
								if(contact_phone_manger.present()){
									contact_phone_manger.toggle();
								}
							}, 1000);
						}); 
						//]]>
					</script>
			
				</div></div>
				
				<!-- email -->
				<div class="control-group email optional"><label class="email optional control-label" for="person_contact_email"> 邮箱</label><div class="controls">
				<c:choose>
				<c:when test="${fn:length(contact.mailList) == 0 }">
				<div class="contact_forms contact_emails" id="contact_email_list_company">
					<div id="blank_slate_company_contact_email" class="blank_slate">添加一个Email地址</div>
					<div class="contact_methods" style="display: none;">
				  			
						<div id="contact_email_8f8e5fd0-c17f-012f-5d5d-000c29568e7b" class="contact_method new_contact_method edit_phone">
							
							<input type="hidden" name="emailids" value="">
							<input class="autofocus" id="person_contact_emails__value" name="emails" size="30" type="text">
							<select id="person_contact_emails__key" name="emailtypes">
								<option selected="selected" value="work">工作</option>
								<option value="personal">个人</option>
								<option value="other">其它</option>
							</select>
							<span class="addremove"><a href="#" class="remove">Remove</a></span>
						</div>
						<div id="add_company_contact_email" class="add_contact_method" style="display: none;">
						  <div class="add"><a href="#">添加..</a></div>
						</div>
					</div>
				</div>
				</c:when>
				<c:otherwise>
				
				<div class="contact_forms contact_emails" id="contact_email_list_company">
					<div id="blank_slate_company_contact_email" class="blank_slate" >添加一个Email地址</div>
					<div class="contact_methods"  style="display: none; ">
				  		
				  		<c:forEach items="${contact.mailList }" var="mail">
						<div id="contact_email_8f8e5fd0-c17f-012f-5d5d-000c29568e7b" class="contact_method new_contact_method edit_phone">
				
							<input type="hidden" name="emailids" value="${mail.id }">
							<input class="autofocus" id="person_contact_emails__value" name="emails" value="${mail.mail }" size="30" type="text">
							<select id="person_contact_emails__key" name="emailtypes">
								<c:choose>
									<c:when test="${mail.type == 'work' }">
										<option selected="selected" value="work">工作</option>
									</c:when>
									<c:otherwise>
										<option value="work">工作</option>
									</c:otherwise>
									</c:choose>
									<c:choose>
									<c:when test="${mail.type == 'personal' }">
										<option value="personal" selected="selected">个人</option>
									</c:when>
									<c:otherwise>
										<option value="personal">个人</option>
									</c:otherwise>
									</c:choose>
									<c:choose>
									<c:when test="${mail.type == 'other' }">
										<option value="other" selected="selected">其它</option>
									</c:when>
									<c:otherwise>
										<option value="other">其它</option>
									</c:otherwise>
								</c:choose>
							</select>
							<span class="addremove"><a href="#" class="remove">Remove</a></span>
						</div>
						</c:forEach>
						
						<div id="add_company_contact_email" class="add_contact_method" style="display: none;">
						  <div class="add"><a href="#">添加..</a></div>
						</div>
					</div>
				</div>
				
				</c:otherwise>
				</c:choose>
				<script type="text/javascript">
					//<![CDATA[
					$(document).ready(function() {
						var contact_email_manger = new ContactInfo.ContactForm("#contact_email_list_company", "<div id=\"contact_email_{safe_id}\" class=\"contact_method new_contact_method edit_phone\">\n	\n		<input class=\"autofocus\" id=\"person_contact_emails__value\" name=\"emails\" size=\"30\" type=\"text\" />\n		<select id=\"person_contact_emails__key\" name=\"emailtypes\"><option value=\"work\">工作<\/option>\n<option value=\"personal\">个人<\/option>\n<option value=\"other\">其它<\/option><\/select>\n		<span class=\"addremove\"><a href=\"#\" class=\"remove\">Remove<\/a><\/span>\n<\/div>");
						setInterval(function(){
							if(contact_email_manger.present()){
								contact_email_manger.toggle();
							}
						}, 1000);
					}); 
					//]]>
				</script>
				</div></div>	
				 
				<div class="control-group string optional">
					<label class="string optional control-label" for="person_contact_im"> IM</label><div class="controls">
					<c:choose>
						<c:when test="${fn:length(contact.imList) == 0 }">
							<div class="contact_forms contact_ims" id="contact_im_list_company">
								<div id="blank_slate_company_contact_im" class="blank_slate" style="cursor:pointer">添加一个即时聊天帐号</div>
								<div class="contact_methods" style="display: none;">
					  			
									<div id="contact_im_8f902250-c17f-012f-5d5e-000c29568e7b" class="contact_method new_contact_method edit_phone">
							
										<input type="hidden" name="imids" value="">
										<input class="autofocus" id="person_contact_ims__value" name="ims" size="30" type="text">
										<select id="person_contact_ims__key" name="imtypes"><option selected="selected" value="qq">QQ</option>
											<option value="gtalk">GTalk</option>
											<option value="msn">MSN</option>
											<option value="other">其它</option>
										</select>	
										<span class="addremove"><a href="#" class="remove">Remove</a></span>
									</div>
									<div id="add_company_contact_im" class="add_contact_method" style="display: none;">
									  <div class="add"><a href="#">添加..</a></div>
									</div>
								</div>
							</div>
						</c:when>
						<c:otherwise>
							
						<div class="contact_forms contact_ims" id="contact_im_list_company">
							<div id="blank_slate_company_contact_im" class="blank_slate" style="cursor:pointer;">添加一个即时聊天帐号</div>
							<div class="contact_methods" style="display: none;">
				  				
				  				<c:forEach items="${contact.imList }" var="im">
								<div id="contact_im_8f902250-c17f-012f-5d5e-000c29568e7b" class="contact_method new_contact_method edit_phone">
									
									<input type="hidden" name="imids" value="${im.id }"/>
									<input class="autofocus" id="person_contact_ims__value" name="ims" value="${im.im }" size="30" type="text">
									<select id="person_contact_ims__key" name="imtypes">
										<c:choose>
											<c:when test="${im.type == 'qq' }">
												<option value="qq" selected="selected">QQ</option>
											</c:when>
											<c:otherwise>
												<option value="qq">QQ</option>
											</c:otherwise>
										</c:choose>
										<c:choose>
											<c:when test="${im.type == 'gtalk' }">
												<option value="gtalk" selected="selected">GTalk</option>
											</c:when>
											<c:otherwise>
												<option value="gtalk">GTalk</option>
											</c:otherwise>
										</c:choose>
										<c:choose>
											<c:when test="${im.type == 'msn' }">
												<option value="msn" selected="selected">MSN</option>
											</c:when>
											<c:otherwise>
												<option value="msn">MSN</option>
											</c:otherwise>
										</c:choose>
										<c:choose>
											<c:when test="${im.type == 'other' }">
												<option value="other" selected="selected">其它</option>
											</c:when>
											<c:otherwise>
												<option value="other">其它</option>
											</c:otherwise>
										</c:choose>
									</select>
									<span class="addremove"><a href="#" class="remove">Remove</a></span>
								</div>
								</c:forEach>
								<div id="add_company_contact_im" class="add_contact_method" style="display: none;">
								  <div class="add"><a href="#">添加..</a></div>
								</div>
							</div>
						</div>
							
						</c:otherwise>
					</c:choose>
					<script type="text/javascript">
						//<![CDATA[
						$(document).ready(function() {
							var contact_im_manger = new ContactInfo.ContactForm("#contact_im_list_company", "<div id=\"contact_im_{safe_id}\" class=\"contact_method new_contact_method edit_phone\">\n	\n		<input class=\"autofocus\" id=\"person_contact_ims__value\" name=\"ims\" size=\"30\" type=\"text\" />\n		<select id=\"person_contact_ims__key\" name=\"imtypes\"><option value=\"qq\">QQ<\/option>\n<option value=\"gtalk\">GTalk<\/option>\n<option value=\"msn\">MSN<\/option>\n<option value=\"other\">其它<\/option><\/select>\n		<span class=\"addremove\"><a href=\"#\" class=\"remove\">Remove<\/a><\/span>\n<\/div>");
							setInterval(function(){
								if(contact_im_manger.present()){
									contact_im_manger.toggle();
								}
							}, 1000);
						}); 
						//]]>
					</script>
				</div></div>	
				<div class="control-group string optional">
					<label class="string optional control-label" for="person_contact_website"> 网站</label><div class="controls">
					<c:choose>
						<c:when test="${fn:length(contact.websiteList) == 0 }">
							<div class="contact_forms contact_websites" id="contact_website_list_company">
								<div id="blank_slate_company_contact_website" class="blank_slate" style="cursor:pointer">添加一个网址</div>
								<div class="contact_methods" style="display: none;">
					  			
									<div id="contact_website_8f923150-c17f-012f-5d5f-000c29568e7b" class="contact_method new_contact_method edit_phone">
										
										<input type="hidden" name="websiteids" value="">
										<input class="autofocus" id="person_contact_websites__value" name="websites" size="30" type="text">
										<select id="person_contact_websites__key" name="websitetypes"><option selected="selected" value="office">公司</option>
											<option value="personal">个人</option>
											<option value="other">其它</option>
										</select>
										<span class="addremove"><a href="#" class="remove">Remove</a></span>
									</div>
									<div id="add_company_contact_website" class="add_contact_method" style="display: none;">
									  <div class="add"><a href="#">添加..</a></div>
									</div>
								</div>
							</div>
						</c:when>
						<c:otherwise>
							
						<div class="contact_forms contact_websites" id="contact_website_list_company">
							<div id="blank_slate_company_contact_website" class="blank_slate" style="cursor:pointer;">添加一个网址</div>
							<div class="contact_methods" style="display:none ;">
				  			
				  				<c:forEach items="${contact.websiteList }" var="website">
								<div id="contact_website_8f923150-c17f-012f-5d5f-000c29568e7b" class="contact_method new_contact_method edit_phone">
						
									<input type="hidden" name="websiteids" value="${website.id }"/>
									<input class="autofocus" id="person_contact_websites__value" name="websites" value="${website.website }" size="30" type="text">
									<select id="person_contact_websites__key" name="websitetypes">
										<c:choose>
											<c:when test="${website.type == 'office' }">
												<option value="office" selected="selected">公司</option>
											</c:when>
											<c:otherwise>
												<option value="office">公司</option>
											</c:otherwise>
										</c:choose>
										<c:choose>
											<c:when test="${website.type == 'personal' }">
												<option value="personal" selected="selected">个人</option>
											</c:when>
											<c:otherwise>
												<option value="personal">个人</option>
											</c:otherwise>
										</c:choose>
										<c:choose>
											<c:when test="${website.type == 'other' }">
												<option value="other" selected="selected">其它</option>
											</c:when>
											<c:otherwise>
												<option value="other">其它</option>
											</c:otherwise>
										</c:choose>
									</select>
									<span class="addremove"><a href="#" class="remove">Remove</a></span>
								</div>
								</c:forEach>
								<div id="add_company_contact_website" class="add_contact_method" style="display: none;">
								  <div class="add"><a href="#">添加..</a></div>
								</div>
							</div>
						</div>
						</c:otherwise>
					</c:choose>
					<script type="text/javascript">
						//<![CDATA[
						$(document).ready(function() {
							var contact_website_manger = new ContactInfo.ContactForm("#contact_website_list_company", "<div id=\"contact_website_{safe_id}\" class=\"contact_method new_contact_method edit_phone\">\n	\n		<input class=\"autofocus\" id=\"person_contact_websites__value\" name=\"websites\" size=\"30\" type=\"text\" />\n		<select id=\"person_contact_websites__key\" name=\"websitetypes\"><option value=\"office\">公司<\/option>\n<option value=\"personal\">个人<\/option>\n<option value=\"other\">其它<\/option><\/select>\n		<span class=\"addremove\"><a href=\"#\" class=\"remove\">Remove<\/a><\/span>\n<\/div>");
							setInterval(function(){
								if(contact_website_manger.present()){
									contact_website_manger.toggle();
								}
							}, 1000);
						}); 
						//]]>
					</script>
				</div></div>	
				<div class="control-group string optional"><label class="string optional control-label" for="person_contact_address"> 地址</label><div class="controls">
					
					<c:choose>
						<c:when test="${fn:length(contact.address) == 0 }">
							<div class="contact_forms contact_address" id="contact_address_list_company">
								<div id="blank_slate_company_contact_address" class="blank_slate" style="cursor:pointer">添加一个地址</div>
								<div class="contact_methods" style="display: none;">
					  			
									<div id="contact_website_8f923150-c17f-012f-5d5f-000c29568e7b" class="contact_method new_contact_method edit_phone">
										<input class="autofocus" id="person_contact_address__value" name="contact.address" size="30" type="text">
									</div>
								
								</div>
							</div>
						</c:when>
						<c:otherwise>
							<div class="contact_forms contact_address" id="contact_address_list_company">
								<div id="blank_slate_company_contact_address" class="blank_slate" style="cursor:pointer;display: none;">添加一个地址</div>
								<div class="contact_methods" style="display: ;">
					  			
									<div id="contact_website_8f923150-c17f-012f-5d5f-000c29568e7b" class="contact_method new_contact_method edit_phone">
										<input class="autofocus" id="person_contact_address__value" name="contact.address" value="${contact.address }" size="30" type="text">
									</div>
								
								</div>
							</div>
						</c:otherwise>
					</c:choose>

					<script type="text/javascript">
						//<![CDATA[
						$(document).ready(function() {
							var contact_address_manger = new ContactInfo.ContactForm("#contact_address_list_company", "<div id=\"contact_address_{safe_id}\" class=\"contact_method new_contact_method edit_phone\">\n	\n		<input class=\"autofocus\" id=\"person_contact_addresses__value\" name=\"contact.address\" size=\"30\" type=\"text\" />	\n<\/div>");
							setInterval(function(){
								if(contact_address_manger.present()){
									contact_address_manger.toggle();
								}
							}, 1000);
						});
						//]]>
					</script>
				</div></div>
			
				<input id="person_contact_sns_attributes_0_key" name="person[contact_sns_attributes][0][key]" value="weibo" type="hidden">
				<div class="control-group string optional">
					<label class="string optional control-label" for="person_contact_sns_attributes_0_value"> 微博</label>
					
					<div class="controls">
						<input class="string optional" id="person_contact_sns_attributes_0_value" name="contact.weibo" value="${contact.weibo }" size="50" type="text">
						<span class="add-on">@</span>
						<select id="" name="contact.weibotype" style="width:60px">
							<c:choose>
								<c:when test="${contact.weibotype == 'weibo.sina.com' }">
									<option value="weibo.sina.com" selected="selected">新浪</option>
								</c:when>
								<c:otherwise>
									<option value="weibo.sina.com">新浪</option>
								</c:otherwise>
							</c:choose>
							<c:choose>
								<c:when test="${contact.weibotype == 't.qq.com' }">
									<option value="t.qq.com" selected="selected">腾讯</option>
								</c:when>
								<c:otherwise>
									<option value="t.qq.com">腾讯</option>
								</c:otherwise>
							</c:choose>
							<c:choose>
								<c:when test="${contact.weibotype == 'https://twitter.com' }">
									<option value="https://twitter.com" selected="selected">Twitter</option>
								</c:when>
								<c:otherwise>
									<option value="https://twitter.com">Twitter</option>
								</c:otherwise>
							</c:choose>
						</select>
						<p class="help-block">输入微博昵称或ID</p>
					</div>
				</div>
			
				<div class="control-group text optional">
					<label class="text optional control-label" for="person_others"> 背景信息</label>
					<div class="controls">
						<textarea class="text optional content" cols="40" id="person_others" name="contact.content" rows="20">${contact.content }</textarea>
						<p class="help-block">简介，如何认识的等</p>
					</div>
				</div>
			
			
				<!-- 权限 -->
				<div class="control-group string optional"><label class="string optional control-label" for="person_access_policy"> 谁可以看见？</label>
				<div class="controls">
			
					<div id="select_access_policy_for_Contact_" class="select_access_policy">
						<div class="radio scope activated">
							<input checked="checked" id="person_access_policy_attributes_scope_everyone" name="contact.view" type="radio" value="a"> 所有同事
						</div>
						<div class="radio scope ">
							<input id="person_access_policy_attributes_scope_owner" name="contact.view" type="radio" value="m:${sessionScope.user.id }"> 只有我能看见
						</div>
						<div class="radio scope ">
							<input id="person_access_policy_attributes_scope_namedgroup" name="contact.view" type="radio" value="NamedGroup"> 选择一个组...
							<div class="editor">
						  	<select class="named_group" id="group" name="contact.view">
						  		<option value="">选择一个组</option>
								<c:forEach items="${groups }" var="group">
									<option value="m:${sessionScope.user.id},g:${group.id }">${group.groupname }</option>
								</c:forEach>
								
							</select> 
							</div>
						</div>
						<div class="radio scope">
							<input id="person_access_policy_attributes_scope_adhocgroup" name="contact.view" type="radio" value="AdhocGroup"> 选择同事...
							<div class="editor">
					  		<select class="new_adhoc_group_member" id="member" name="contact.view">
					  			<option value="">选择一个同事</option>
					  			<c:forEach items="${users }" var="user">
					  				<c:if test="${user.id != sessionScope.user.id}">
					  					<option value="m:${sessionScope.user.id},u:${user.id}">${user.username }</option>
					  				</c:if>
					  			</c:forEach>
						  		
							</select> 
							</div>
						</div>
					</div>
				</div>
	

			<script type="text/javascript">
				var container = $('#select_access_policy_for_Contact_');
				$('.scope input[type=radio]', container).live('click', function(event) {
					var activated = $(event.target).parent();
					$('.scope.activated', container).removeClass('activated');
					activated.addClass('activated');
						//changePermission();
				  });
				
				$(document).ready(function(){
					
					$("#group").change(function() {
						$("#person_access_policy_attributes_scope_namedgroup").attr("value",$("#group").val());
					});
					
					$("#member").change(function() {
						$("#person_access_policy_attributes_scope_adhocgroup").attr("value",$("#member").val());
					});
				});
	
			</script>
		
			</div>
				<div class="form-actions">
					<input class="btn btn-primary" data-loading-text="处理中.." name="commit" value="修改联系人" type="submit">
					<a href="${basePath }/contact/show?id=${contact.id}" class="btn">取消</a>
				</div>
			</form>

			</div>
		</div>
	</div>
	<div class="span4 sidebar">
		<div class="well">
			<legend>您还可以通过以下方式导入联系人</legend>
			<ul>
				<li><a href="${basePath }/contact/import?from=csv">上传CSV文件</a></li>
				<p>大部分数据库和表格程序都可以导出CSV格式的文件</p>
				<li><a href="${basePath }/contact/import?from=xls">上传Excel文件</a></li>
				<p>目前我们只支持微软老版本的Excel格式，还不支持.xlsx格式，请在导入前转成.xls格式</p>
			</ul>
		</div>

	</div>
	</div>
</div>
	

</body></html>
